<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/struts-bean" prefix="bean"%> 
<%@ taglib uri="/WEB-INF/tld/struts-html" prefix="html"%>
<%@ taglib uri="/WEB-INF/tld/struts-logic" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tld/jstl/c" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="/WEB-INF/tld/jstl/fn" prefix="fn" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="ebb365,ebb365,ebb365">
<meta http-equiv="description" content="ebb365">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="/admin/css/css.css"></link>
<script language="JavaScript">
<!--//
function selectAll(choice) {
	for (var i=0;i<document.theForm.checkboxparam.length;i++) {
		var e=document.theForm.checkboxparam[i];
		if(choice==1)e.checked=true;
		if(choice==2)e.checked=(e.checked?false:true);
		if(choice==3)e.checked=false;
	}
}

function checkboxIsSelected(){
   for (var i=0;i<document.theForm.checkboxparam.length;i++) {
        var e=document.theForm.checkboxparam[i];
        if(e.checked)return true;  
   }
   window.alert('至少选择一项!');
   return false;
}
//-->
</script>
</head>
<body>
<logic:present name="del_successfully">
<bean:write name="del_successfully" filter="false"/>
</logic:present>
<form action="NewsManageAction.do?method=deleteNews" name="theForm" method="post">
<table width="750" border="1" align="center" cellpadding="0" cellspacing="0">
   <tr>
       <td>※</td><td>编号</td><td>咨询标题</td><td>咨询作者</td><td>点击次数</td><td>发布时间</td><td>是否审核</td><td>操作</td>
   </tr>
<tbody>
<logic:present name="newslist">
<logic:iterate id="list" name="newslist" >
<tr>
<td><input type="checkbox" name="checkboxparam" value="${list.id}"></td>
<td>${list.id}</td>
<td><html:link href="NewsManageAction.do?method=showNewsDetail&id=${list.id}" >${list.title}</html:link></td>
<td><bean:write name="list" property="writer"/></td>
<td><bean:write name="list" property="hits"/></td>
<td><bean:write name="list" property="datetime" format="yyyy年MM月dd日"/></td>
<td>
<logic:equal value="1" name="list" property="sh">
<font color=green>通过</font>
</logic:equal>
<logic:notEqual value="1" name="list" property="sh">
<font color=red>未通过</font>
</logic:notEqual>
<td><html:link href="NewsManageAction.do?method=toEdit&id=${list.id}" >编辑</html:link></td>
</tr>
</logic:iterate>
</logic:present>
</tbody>
</table>
<table width="750"  border="1" align="center" cellpadding="0" cellspacing="0">
<tr><td height="4"></td></tr>
<tr><td>
<html:button onclick="selectAll(1);" property="button" value="全选"/>&nbsp;
<html:button onclick="selectAll(2);" property="button" value="反选"/>&nbsp;
<html:button onclick="selectAll(3);" property="button" value="不选"/>&nbsp;
<input type="submit" value="选择删除" name="submit" onclick="return checkboxIsSelected();"></td></tr>
</table>
</form>

 <table width="750"  border="1" align="center" cellpadding="0" cellspacing="0">
            <tr>
               <td colspan="8" align="center">
                      当前是第${curPage}页,&nbsp;&nbsp;总共${allPage}页&nbsp;&nbsp;
                       <html:link href="NewsManageAction.do?method=getNewsByPagination&curPage=${curPage}&backPage=${backPage}&nextPage=${nextPage}&page=${page}&pageSize=${pageSize}&todo=backPage" >上一页</html:link>
                      &nbsp;&nbsp;
                       <html:link href="NewsManageAction.do?method=getNewsByPagination&curPage=${curPage}&backPage=${backPage}&nextPage=${nextPage}&page=${page}&pageSize=${pageSize}&todo=nextPage" >下一页</html:link>
                      
                </td>                 
            </tr>
</table>
</body>
</html>